{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/base.css" media="all">
<body>
<div class="layui-fluid layui-anim layui-anim-upbit">
    <div class="layui-card">
        {if $search}
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="nav_search">
                {include file="form/items/search" type='1' /}
            </div>
        </div>
        {/if}
        <div class="layui-card-body">
            <div style="display: flex;align-items: center;justify-content: space-between">
                <div class="layui-btn-container" style="flex: 1">
                    {foreach name="top_buttons" item="vo"}
                    {if $vo.title == '导出'}
                    <a class="{$vo.class}" data-json='<?php echo json_encode($vo);?>' data-title="{$nav.s_nav}"
                       data-url="{:url('getList',array_merge($Request.param,$extra_map))}&export=1"
                       onclick="{$vo.onclick}">
                        <i class="layui-icon {$vo.icon}"></i>{$vo.title}
                    </a>
                    {else}
                    <a class="{$vo.class} {if !empty($vo.init)} table-top-init{/if}"  data-json='<?php echo json_encode($vo);?>' {if empty($vo.init)}onclick="{$vo.onclick}"{/if}>
                    <i class="layui-icon {$vo.icon}"></i>{$vo.title}
                    </a>
                    {/if}
                    {/foreach}
                </div>
                {if $census}
                <div class="layui-row statistics_list"></div>
                {/if}
            </div>
            <table id="formTable" lay-filter="table"></table>
        </div>
    </div>
</div>
</body>
<!-- 渲染附加的html -->
<?php echo $extra_html;?>
<input type="hidden" id="tableColumns" value='<?php echo json_encode($columns);?>'/>
<input type="hidden" id="tableUniqueStr" value="{$extra_map.tableUniqueStr}"/>
<input type="hidden" id="tableUniqueTitle" value="{$nav.s_nav}"/>
{include file="public/footer" /}
{foreach name="js_url" item="vo"}
<script type="text/javascript" src="/static/admin/form/js/{$vo}.js"></script>
{/foreach}
<script>
    $(function () {
        $('.table-top-init').each(function () {
            var json = JSON.parse($(this).attr('data-json'));
            if ($.isFunction(common[json.event])) {
                return common[json.event](json);
            } else {
                notify.error('handle.js中未定义【' + json.event + '】方法，请先定义后再调用！');
            }
        })
        tableRender("#formTable", JSON.parse($("#tableColumns").val()), "{:url('getList', array_merge($Request.param,$extra_map))}", {$totalRow})
    })
</script>
</html>